<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>个人中心</title>
    <link type="image/x-icon" rel="shortcut icon"  href="/images/logo.ico">
    <link rel="stylesheet" href="/stylesheets/bootstrap.css">
    <link rel="stylesheet" href="/stylesheets/index.css">
    <link rel="stylesheet" href="/stylesheets/presnol.css">
</head>
<body>
    <div class="container">
        <%include header%>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-xs-2 col-md-2">
                <ul class="list-group text-center">
                    <li class="list-group-item disabled">个人中心</li>
                    <li class="list-group-item p_list nav_color" >我的收藏</li>
                    <li class="list-group-item p_list" onclick="getOrder()">我的订单</li>
                    <li class="list-group-item p_list" onclick="getUserInfo('<%=loginUser._id%>')">个人设置</li>
                    <li class="list-group-item p_list">隐私设置</li>
                    <li class="list-group-item p_list" onclick="getAdress('<%=loginUser._id%>')">地址管理</li>
                </ul>
            </div>
            <div class="col-xs-10 col-md-10">
                <ul class="list-group">
                    <li class="list-group-item pre_list">
                        <div class="row" id="collectList">
                            <%if(book.length<1){%>
                                <div class="col-xs-12 col-md-12 text-center color"><h4>你还没有收藏任何书 ! 快去挑选喜欢的书吧 !</h4></div>
                            <%}else{%>
                                <%for(var i=0;i<book.length;i++){%>
                                    <div class="col-xs-4 col-md-3 book_list">
                                        <ul class="list-group book_list2">
                                            <li class="list-group-item">
                                                <a href="/bookDetil/?id=<%=book[i].book_id._id%>"><img src="/images/books/<%=book[i].book_id.img%>" style="width:180px;height:auto"></a>
                                                <span class="topKuang2">
                                                    <a href="javascript:void(0)" onclick="cancelCollect('<%=book[i].book_id._id%>')">取消收藏</a>
                                                    <a href="javascript:void(0)" class="add_scar" onclick="join('<%=book[i].book_id._id%>')">加入购物车</a>
                                                </span>
                                            </li>
                                            <li class="list-group-item" style="min-height:100px">
                                                <p>
                                                    <a href="/bookDetil/?id=<%=book[i].book_id._id%>" class="color"><%=book[i].name%></a>
                                                </p>
                                                <p class="text-muted" style="margin-left:8px">
                                                    <%=book[i].author%>
                                                </p>
                                                <p class="pull-right color2" style="font-size:18px">￥
                                                    <%=book[i].money%>
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                <%}%>
                            <%}%>        
                        </div>
                    </li>
                    <li class="list-group-item pre_list" style="display:none;overflow:hidden">
                        <div class="row text-center" >
                            <div class="col-xs-2 col-md-2">
                                <span>我的订单</span>
                            </div>
                            <div class="col-xs-2 col-md-2 orderTab bottom_color">
                                <span>全部</span>
                            </div>
                            <div class="col-xs-2 col-md-2 orderTab">
                                <span>待付款</span>
                            </div>
                            <div class="col-xs-2 col-md-2 orderTab">
                                <span>待发货</span>
                            </div>
                            <div class="col-xs-2 col-md-2 orderTab">
                                <span>待收货</span>
                            </div>
                            <div class="col-xs-2 col-md-2 orderTab">
                                <span>待评价</span>
                            </div>
                        </div>
                        <div>
                            <div class="row text-center text-muted order_list">
                                <div style="background:#e9e9e9;height:40px;line-height:40px;margin-top:20px;font-size:12px"> 
                                    <div class="col-xs-2 col-md-2">
                                        <span>订单号</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2 ">
                                        <span class="order_list_span">商品数量</span>
                                    </div>
                                    <div class="col-xs-1 col-md-1">
                                        <span class="order_list_span">金额</span>
                                    </div>
                                    <div class="col-xs-4 col-md-4">
                                        <span class="order_list_span">时间</span>
                                    </div>
                                    <div class="col-xs-1 col-md-1">
                                        <span class="order_list_span">付款状态</span>
                                    </div>
                                    <div class="col-xs-1 col-md-1">
                                        <span class="order_list_span">订单状态</span>
                                    </div>
                                    <div class="col-xs-1 col-md-1">
                                        <span class="order_list_span">操作</span>
                                    </div>
                                </div>    
                                <div id="orderList">
                                </div>
                            </div>
                            <div class="row order_list" style="display:none">
                                <p style="margin-left:50px;margin-top:50px">订单号 : <span class="color2">123456</span> <span style="margin-left:50px">订单状态 : <span class="color2">未完成</span></span></p>
                                <p style="margin-left:50px;">收货人 : <span class="text-muted">栗豪</span></p>
                                <p style="margin-left:50px;">收货地址 : <span class="text-muted">河南省郑州市</span></p>
                                <p style="margin-left:50px;">联系方式 : <span class="text-muted">18719299595</span></p>
                                <span style="margin-left:80%;margin-bottom:10px">
                                        <span class="nav_color subBtn">立即付款</span> <span class="subBtn2" style="border:1px solid #3CB371;color: #3CB371;">取消订单</span>
                                    </span>
                                <div class="row text-center text-muted" style="background:#e9e9e9;height:40px;line-height:40px;margin-top:20px;">
                                    <div class="col-xs-6 col-md-6">
                                        购买信息
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        金额
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        数量
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        小计
                                    </div>
                                </div>
                                <div class="row text-center">
                                    <div class="col-xs-6 col-md-6">
                                        <img src="/images/books/dygw.jpg" style="margin-top:10px;margin-bottom:10px;max-height:150px">
                                        <span class="text-muted">《解忧杂货店》--东野圭吾</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        1
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                </div>
                                <div class="row text-center text-muted" style="background:#e9e9e9;margin-bottom:-20px;padding:10px 0px">
                                    <div class="col-xs-12 col-md-12 text-right">
                                        <span style="margin-right:50px">商品总金额 : <span class="color2" style="font-size:18px">￥59</span></span>
                                        <p><span style="margin-right:50px">应付总金额 : <span class="color2" style="font-size:18px">￥59</span></span>
                                    </div>
                                </div>
                            </div>
                            <div class="row order_list" style="display:none">
                                <p style="margin-left:50px;margin-top:50px">订单号 :
                                    <span class="color2">123456</span>
                                    <span style="margin-left:50px">订单状态 :
                                        <span class="color2">未完成</span>
                                    </span>
                                </p>
                                <p style="margin-left:50px;">收货人 :
                                    <span class="text-muted">栗豪</span>
                                </p>
                                <p style="margin-left:50px;">收货地址 :
                                    <span class="text-muted">河南省郑州市</span>
                                </p>
                                <p style="margin-left:50px;">联系方式 :
                                    <span class="text-muted">18719299595</span>
                                </p>
                                <span style="margin-left:87%;margin-bottom:10px">
                                    <span class="nav_color subBtn">联系卖家</span>
                                </span>
                                <div class="row text-center text-muted" style="background:#e9e9e9;height:40px;line-height:40px;margin-top:20px;">
                                    <div class="col-xs-6 col-md-6">
                                        购买信息
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        金额
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        数量
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        小计
                                    </div>
                                </div>
                                <div class="row text-center">
                                    <div class="col-xs-6 col-md-6">
                                        <img src="/images/books/dygw.jpg" style="margin-top:10px;margin-bottom:10px;max-height:150px">
                                        <span class="text-muted">《解忧杂货店》--东野圭吾</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        1
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                </div>
                                <div class="row text-center text-muted" style="background:#e9e9e9;margin-bottom:-20px;padding:10px 0px">
                                    <div class="col-xs-12 col-md-12 text-right">
                                        <span style="margin-right:50px">商品总金额 :
                                            <span class="color2" style="font-size:18px">￥59</span>
                                        </span>
                                        <p>
                                            <span style="margin-right:50px">应付总金额 :
                                                <span class="color2" style="font-size:18px">￥59</span>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="row  order_list" style="display:none">
                            <p style="margin-left:50px;margin-top:50px">订单号 :
                                <span class="color2">123456</span>
                                <span style="margin-left:50px">订单状态 :
                                    <span class="color2">未完成</span>
                                </span>
                            </p>
                            <p style="margin-left:50px;">收货人 :
                                <span class="text-muted">栗豪</span>
                            </p>
                            <p style="margin-left:50px;">收货地址 :
                                <span class="text-muted">河南省郑州市</span>
                            </p>
                            <p style="margin-left:50px;">联系方式 :
                                <span class="text-muted">18719299595</span>
                            </p>
                            <p style="margin-left:50px;">物流信息 :
                                <span class="text-muted">韵达快递123456</span>
                            </p>
                            <span style="margin-left:87%;margin-bottom:10px">
                                <span class="nav_color subBtn">确认收货</span>
                            </span>
                            <div class="row text-center text-muted" style="background:#e9e9e9;height:40px;line-height:40px;margin-top:20px;">
                                <div class="col-xs-6 col-md-6">
                                    购买信息
                                </div>
                                <div class="col-xs-2 col-md-2">
                                    金额
                                </div>
                                <div class="col-xs-2 col-md-2">
                                    数量
                                </div>
                                <div class="col-xs-2 col-md-2">
                                    小计
                                </div>
                            </div>
                            <div class="row text-center">
                                <div class="col-xs-6 col-md-6">
                                    <img src="/images/books/dygw.jpg" style="margin-top:10px;margin-bottom:10px;max-height:150px">
                                    <span class="text-muted">《解忧杂货店》--东野圭吾</span>
                                </div>
                                <div class="col-xs-2 col-md-2" style="line-height:160px">
                                    ￥59
                                </div>
                                <div class="col-xs-2 col-md-2" style="line-height:160px">
                                    1
                                </div>
                                <div class="col-xs-2 col-md-2" style="line-height:160px">
                                    ￥59
                                </div>
                            </div>
                            <div class="row text-center text-muted" style="background:#e9e9e9;margin-bottom:-20px;padding:10px 0px">
                                <div class="col-xs-12 col-md-12 text-right">
                                    <span style="margin-right:50px">商品总金额 :
                                        <span class="color2" style="font-size:18px">￥59</span>
                                    </span>
                                    <p>
                                        <span style="margin-right:50px">应付总金额 :
                                            <span class="color2" style="font-size:18px">￥59</span>
                                        </span>
                                </div>
                            </div>
                            </div>
                            <div class="row order_list" style="display:none">
                                <p style="margin-left:50px;margin-top:50px">订单号 :
                                    <span class="color2">123456</span>
                                    <span style="margin-left:50px">订单状态 :
                                        <span class="color2">已完成</span>
                                    </span>
                                </p>
                                <p style="margin-left:50px;">收货人 :
                                    <span class="text-muted">栗豪</span>
                                </p>
                                <p style="margin-left:50px;">收货地址 :
                                    <span class="text-muted">河南省郑州市</span>
                                </p>
                                <p style="margin-left:50px;">联系方式 :
                                    <span class="text-muted">18719299595</span>
                                </p>
                                <p style="margin-left:50px;">物流信息 :
                                    <span class="text-muted">韵达快递123456</span>
                                </p>
                                <span style="margin-left:87%;margin-bottom:10px">
                                    <span class="nav_color subBtn"  data-toggle="modal" data-target="#scoreModal">立即评价</span>
                                </span>
                                <div class="row text-center text-muted" style="background:#e9e9e9;height:40px;line-height:40px;margin-top:20px;">
                                    <div class="col-xs-6 col-md-6">
                                        购买信息
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        金额
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        数量
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        小计
                                    </div>
                                </div>
                                <div class="row text-center">
                                    <div class="col-xs-6 col-md-6">
                                        <img src="/images/books/dygw.jpg" style="margin-top:10px;margin-bottom:10px;max-height:150px">
                                        <span class="text-muted">《解忧杂货店》--东野圭吾</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        1
                                    </div>
                                    <div class="col-xs-2 col-md-2" style="line-height:160px">
                                        ￥59
                                    </div>
                                </div>
                                <div class="row text-center text-muted" style="background:#e9e9e9;margin-bottom:-20px;padding:10px 0px">
                                    <div class="col-xs-12 col-md-12 text-right">
                                        <span style="margin-right:50px">商品总金额 :
                                            <span class="color2" style="font-size:18px">￥59</span>
                                        </span>
                                        <p>
                                            <span style="margin-right:50px">应付总金额 :
                                                <span class="color2" style="font-size:18px">￥59</span>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="row text-center order_list" style="display:none">
                                
                            </div>
                        </div>
                    </li>
                    <li class="list-group-item pre_list" style="display:none">
                        <div style="margin-left:40%">
                            <img src="/images/男士.png" alt="">
                            <p><span class="nav_color subBtn" style="margin-left:50px">上传头像</span></p>
                            <div style="margin-top:40px" id="userinfo">
                            </div>
                        </div>
                    </li>
                    <li class="list-group-item pre_list" style="display:none">
                        <ul class="list-group">
                            <p>密码设置</p>
                            <li class="list-group-item">
                                <div class="form-group">
                                    <label for="name">原密码</label>
                                    <input type="password" class="form-control" placeholder="原密码" onblur="original_password()" id="original_password">
                                </div>
                                <div class="form-group">
                                    <label for="name">新密码</label>
                                    <input type="password" class="form-control" placeholder="新密码" onblur="new_password()" id="new_password">
                                </div>
                                <div class="form-group">
                                    <label for="name">确认密码</label>
                                    <input type="password" class="form-control" placeholder="确认密码" onblur="new_password_two()" id="new_password_two">
                                </div>
                            </li>
                        </ul>
                        <span class="nav_color subBtn" style="margin-left:93.5%;" onclick="updatePassword()">确认</span>
                    </li>
                    <li class="list-group-item pre_list" style="display:none">
                        <h5>收货地址</h5>
                        <p style="margin-top:20px"><button class="nav_color subBtn" data-toggle="modal" data-target="#addressModal" onclick="addAdress()">新增地址</button></p>
                        <ul class="list-group">
                            <li class="list-group-item text-center" style="color:#3CB371;background:#e9e9e9">
                                <div class="row">
                                    <div class="col-xs-1 col-md-1">
                                        <span>收货人</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        <span>所在地区</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        <span>详细地址</span>
                                    </div>
                                    <div class="col-xs-1 col-md-1">
                                        <span>邮编</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        <span>联系方式</span>
                                    </div>
                                    <div class="col-xs-2 col-md-2">
                                        <span>操作</span>
                                    </div>
                                </div>
                            </li>
                            <li class="list-group-item text-center"> 
                                <div class="row" id="adressList">
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>


    <!-- 个人资料修改模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title text-center" id="myModalLabel">个人资料修改</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="name">昵称: </label>
                        <input type="text" class="form-control" required placeholder="昵称" id="userNikename">
                    </div>
                    <div class="form-group">
                        <label for="name">性别 : </label>
                        <select class="form-control" id="userSex">
                            <option>男</option>
                            <option>女</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="name">出生年月: </label>
                        <input type="text" class="form-control" required placeholder="出生年月"  id="userBirthday">
                    </div>
                    <div class="form-group">
                        <label for="name">自我介绍: </label>
                        <textarea class="form-control" required rows="3" id="userAboutme"></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" onclick="updateUser('<%=loginUser._id%>')">确定</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal -->
    </div>

     <!-- 修改地址模态框（Modal） -->
     <div class="modal fade" id="addressModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title text-center" id="myModalLabel">新增地址</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="name">收货人: </label>
                        <input type="text" class="form-control" placeholder="收货人" id="adressWho">
                    </div>
                    <div class="form-group">
                        <label for="name">所在地区: </label>
                        <input type="text" class="form-control" placeholder="所在地区" id="adressPlace">
                    </div>
                    <div class="form-group">
                        <label for="name">详细地址: </label>
                        <input type="text" class="form-control" placeholder="详细地址" id="aderssPlaceDetil">
                    </div>
                    <div class="form-group">
                        <label for="name">邮编: </label>
                        <input type="text" class="form-control" placeholder="邮编" id="adressZipCode">
                    </div>
                    <div class="form-group">
                        <label for="name">联系方式: </label>
                        <input type="text" class="form-control" placeholder="联系方式" id="adressPhone">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" onclick="Adress()">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    

    <!-- 订单详情模态框（Modal） -->
    <div class="modal fade" id="orderListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title text-center" id="myModalLabel">我的订单</h4>
                </div>
                <div class="modal-body" id="ModalorderList">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-success" data-dismiss="modal">关闭</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal -->
    </div>

    <!-- 删除地址模态框（Modal） -->
    <div class="modal fade" id="deleteAdressModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title text-center" id="myModalLabel">删除地址</h4>
                </div>
                <div class="modal-body"><h4 class="text-danger">确定要删除地址吗?</h4></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="deleteAdress()">确定</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal -->
    </div>
</body>

<script src="/javascripts/jquery-3.2.1.min.js"></script>
<script src="/javascripts/bootstrap.js"></script>
<script src="/javascripts/jquery.fly.min.js"></script>
<script src="/javascripts/layer/layer.js"></script>
<script src="/javascripts/presnol.js"></script>
</html>
